import { Application } from 'egg';

export default (app: Application) => {
  const { controller, router } = app;

  router.get('/', controller.home.index);

  //! APP客户端API
  router.get('/app/video/getAppBaseConfig', controller.video.getVideo.getAppBaseConfig)

  router.get('/app/video/getVideo', controller.video.getVideo.getVideoList)
  router.get('/app/video/getSingleVideoDetail', controller.video.getVideo.getSingleVideoDetail)
  router.get('/app/video/getVideoDetail', controller.video.getVideo.getVideoDetail)
  router.get('/app/video/getRandomVideo', controller.video.getVideo.getRandomVideo)
  router.get('/app/video/getChannelList', controller.video.getVideo.getChannelList)
  router.get('/app/video/getVideo/analysis', controller.video.getVideo.analysis)
  router.get('/app/video/getVideoByQuery', controller.video.getVideo.getVideoByQuery)

  router.post('/app/video/user/feedback', controller.video.user.submitFeedback);


  router.post('/app/video/user/saveUserByUuid', controller.video.user.saveUserByUuid);

  //! 后台网页API
  //? 用户信息管理 
  router.post('/admin/user/login', controller.admin.user.Login)
  router.post('/admin/user/logout', controller.admin.user.loginOut)
  router.get('/admin/user/getInfo', controller.admin.user.getUserInfo)

  //? 电影信息管理
  router.post('/admin/video/getList', controller.admin.video.getVideoList)
  router.get('/admin/video/deleteVideo', controller.admin.video.deleteVideo)
  router.get('/admin/video/videoDetail', controller.admin.video.getVideoDetail)
  router.get('/admin/video/searchByQuery', controller.admin.video.searchVideoByQuery)
  router.post('/admin/video/updateVideoInfo', controller.admin.video.updateVideoInfo)
  router.post('/admin/video/addVideo', controller.admin.video.addVideo)
  router.post('/admin/video/updaQisimInfo', controller.admin.video.updaQisimInfo)
  router.get('/admin/video/deleteQisim', controller.admin.video.deleteQisim)

  //? 电影分类管理 
  router.get('/admin/sort/getVideoSorts', controller.admin.sort.getVideoSort)
  router.post('/admin/sort/saveVideoSort', controller.admin.sort.saveVideoSort)
  //? 电影分类管理 
  router.get('/admin/sort/getVideoRegions', controller.admin.sort.getVideoRegions)
  router.post('/admin/sort/saveVideoRegions', controller.admin.sort.saveVideoRegions)
  //? 广告管理
  router.get('/admin/advertise/getAdConfig', controller.admin.advertise.getAdConfig)
  router.post('/admin/advertise/setAdConfig', controller.admin.advertise.setAdConfig)
  //? 反馈管理
  router.get('/admin/feedback/getList', controller.admin.feedback.getList)
  router.get('/admin/feedback/getDeviceList', controller.admin.feedback.getDeviceList)
  //? 实用工具
  router.post('/admin/tools/getMpWxv', controller.admin.tools.getMpWxv)


};
